struct BaseStruct
{
unsigned int tileno;
unsigned int draw;
unsigned int flag;
unsigned int x, y;
};
|
tileno refers to the tile number to load from the Allegro graphics
datafile. These numbers correspond to the numbers in the outputted
header file from Allegro's "grabber" program. In most cases, you don't
need to worry about this. It's already set when you save a map file.
draw is a flag, either 0 or 1 telling the TileLib engine whether or not
this tile should be drawn. If it's 0, the tile will not be drawn,
otherwise if it's 1, it will be drawn.
flag is a misc. flag that can take on whatever value you like, useful
for, guess what, setting flags on tiles. With this, you could check if
a user steps on a tile that has say a flag value of "15", which you could
recognize in your program as being a bear trap that kills him. Or
something like that =)
x, y are the offsets in pixels within the tile's spacing to place the tile.
Most normal people will have this as a value between 0 and the width/height
of the tile bitmap.
struct FringeStruct
{
unsigned int tileno;
unsigned int draw;
unsigned int flag;
unsigned int x, y;
};
|
tileno refers to the tile number to load from the Allegro graphics
datafile. These numbers correspond to the numbers in the outputted
header file from Allegro's "grabber" program. In most cases, you don't
need to worry about this. It's already set when you save a map file.
draw is a flag, either 0 or 1 telling the TileLib engine whether or not
this tile should be drawn. If it's 0, the tile will not be drawn,
otherwise if it's 1, it will be drawn.
flag is a misc. flag that can take on whatever value you like, useful
for, guess what, setting flags on tiles. With this, you could check if
a user steps on a tile that has say a flag value of "15", which you could
recognize in your program as being a bear trap that kills him. Or
something like that =)
x, y are the offsets in pixels within the tile's spacing to place the tile.
Most normal people will have this as a value between 0 and the width/height
of the tile bitmap.
struct ObjectStruct
{
unsigned int tileno;
unsigned int active;
unsigned int draw;
unsigned int flag;
unsigned int x, y;
};
|
tileno refers to the tile number to load from the Allegro graphics
datafile. These numbers correspond to the numbers in the outputted
header file from Allegro's "grabber" program. In most cases, you don't
need to worry about this. It's already set when you save a map file.
Active is just a flag-like field. It is not used internally by TileLib,
but is provided as a convenience for things like hiding/unhiding objects
or making them active/inactive. For example, a lever couuld initially
have the active field not set, and when a user presses it, you could
set the lever. Then you could just do a check for if (lever.active)
in determiniing an action to take. I could have left this out, but I
felt that people would want a separate active state, rather than having
to use a bunch of flags.
draw is a flag, either 0 or 1 telling the TileLib engine whether or not
this tile should be drawn. If it's 0, the tile will not be drawn,
otherwise if it's 1, it will be drawn.
flag is a misc. flag that can take on whatever value you like, useful
for, guess what, setting flags on tiles. With this, you could check if
a user steps on a tile that has say a flag value of "15", which you could
recognize in your program as being a bear trap that kills him. Or
something like that =)
x, y are the offsets in pixels within the tile's spacing to place the tile.
Most normal people will have this as a value between 0 and the width/height
of the tile bitmap.
struct RoofStruct
{
unsigned int tileno;
unsigned int group;
unsigned int draw;
unsigned int flag;
unsigned int x, y;
};
|
tileno refers to the tile number to load from the Allegro graphics
datafile. These numbers correspond to the numbers in the outputted
header file from Allegro's "grabber" program. In most cases, you don't
need to worry about this. It's already set when you save a map file.
Tiles are assigned to groups. This way,
you can tell TileLib to remove all tiles belonging to a particular
group number, and in that way, only remove rooves from select buildings
or whatever at a time. Group assignment is arbitrary and is up to the user.
draw is a flag, either 0 or 1 telling the TileLib engine whether or not
this tile should be drawn. If it's 0, the tile will not be drawn,
otherwise if it's 1, it will be drawn.
flag is a misc. flag that can take on whatever value you like, useful
for, guess what, setting flags on tiles. With this, you could check if
a user steps on a tile that has say a flag value of "15", which you could
recognize in your program as being a bear trap that kills him. Or
something like that =)
x, y are the offsets in pixels within the tile's spacing to place the tile.
Most normal people will have this as a value between 0 and the width/height
of the tile bitmap.